package tripService;

import com.jfinal.kit.HashKit;

import tripModel.User;

public class UserService {
	public static final User loginByEmail(String Email, String PassWord) {
		String uEmail = HashKit.md5(Email);
		String uPassWord = HashKit.md5(PassWord);
		return User.dao.findFirst("select uID,uName,uImgPath from user where uEmail=? and uPassWord=?", uEmail,
				uPassWord);
	}

	public static final User loginByPhone(String Phone, String PassWord) {
		String uPhone = HashKit.md5(Phone);
		String uPassWord = HashKit.md5(PassWord);
		return User.dao.findFirst("select uID,uName,uImgPath from user where uEmail=? and uPassWord=?", uPhone,
				uPassWord);
	}
}
